import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { rules } from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '影响因子名称',
    align: "center",
    dataIndex: 'factorName'
  },
  {
    title: '影响因子码值',
    align: "center",
    dataIndex: 'factorCode'
  },
  {
    title: '创建日期',
    align: "center",
    dataIndex: 'sysCreateDate'
  },
  {
    title: '储存字段',
    align: "center",
    dataIndex: 'saveCode'
  },
  {
    title: '排序',
    align: "center",
    dataIndex: 'displayOrder'
  },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    field: 'factorName',
    label: '影响因子名称',
    component: 'Input',
    colProps: { span: 8 },
  },
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '影响因子名称',
    field: 'factorName',
    component: 'Input',
    required: true,
  },
  {
    label: '存储字段',
    field: 'saveCode',
    component: 'Select',
    required: true,
    componentProps: {
      options: [
        {
          label: 'elementScore1',
          value: 'elementScore1',
        },
        {
          label: 'elementScore2',
          value: 'elementScore2',
        },
        {
          label: 'elementScore3',
          value: 'elementScore3',
        },
        {
          label: 'elementScore4',
          value: 'elementScore4',
        },
        {
          label: 'elementScore5',
          value: 'elementScore5',
        },
        {
          label: 'elementScore6',
          value: 'elementScore6',
        },
        {
          label: 'elementScore7',
          value: 'elementScore7',
        },
        {
          label: 'elementScore8',
          value: 'elementScore8',
        },
        {
          label: 'elementScore9',
          value: 'elementScore9',
        },
        {
          label: 'elementScore10',
          value: 'elementScore10',
        },
      ],
    },
  },
  {
    label: '排序',
    field: 'displayOrder',
    component: 'InputNumber',
  },
  // TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false
  },
];

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[] {
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}